package SV_XPATH;

public class Example {
    protected void doGet(HttpServletRequest httpServletRequest,
                         HttpServletResponse httpServletResponse) throws ServletException, IOException {
        super.doGet(httpServletRequest, httpServletResponse);
        String userName = httpServletRequest.getParameter("user.name");
        String userDescr = httpServletRequest.getParameter("user.descr");
        CompiledExpression compiledExpression = JXPathContext.compile("string(//user[name/text()='" + userName + "']/account/text())");
        compiledExpression.setValue(context, userDescr);
        httpServletResponse.getOutputStream().println("User info updated");
    }
}
